package entity.sparemanage;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 备件台账
 * </p>
 *
 * @author beisheng
 * @since 2023-05-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SpareLedger implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 序号
     */
    @TableId(value = "sp_id", type = IdType.AUTO)
    private Integer spId;

    /**
     * 主键
     */
    private Integer imageId;

    /**
     * 备件编码
     */
    private String spCode;

    /**
     * 备件名称
     */
    private String spName;

    /**
     * 库存下限
     */
    private Integer lowerInventory;

    /**
     * 总库存
     */
    private Integer totalInventory;

    /**
     * 库存金额
     */
    private Double amountInventory;

    /**
     * 更换周期
     */
    private String replaceCycle;

    /**
     * 生产厂商ID
     */
    private Integer facturerId;

    /**
     * 生产厂商
     */
    private String factureName;

    /**
     * 操作人
     */
    private String operator;

    /**
     * 规格型号
     */
    private String spSpecification;

    /**
     * 备件类型id
     */
    private Integer spTypeId;

    /**
     * 备件单位
     */
    private Integer saUnit;

    /**
     * 库存上限
     */
    private Integer upperInventory;

    /**
     * 备件信息备注
     */
    private String saRemark;

    /**
     * 关联设备ID
     */
    private String deviceIds;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updateTime;

    /**
     * 删除标识(0未删除,1已删除)
     */
    private Integer deleteFlag;

    //备件编号和备件名称名
    @TableField(exist = false)
    private String codeName;

    @TableField(exist = false)
    private String spTypeName;

    @TableField(exist = false)
    private Integer differ;
}
